//
//  HeroDemoVC.m
//  Demo
//
//  Created by lx on 2018/12/26.
//  Copyright © 2018 mgz. All rights reserved.
//

#import "HeroDemoVC.h"
#import <Hero.h>
#import <UIKit+Hero.h>
#import <Masonry.h>
#import "HeroTWODemoVC.h"
@interface HeroDemoVC ()

@end

@implementation HeroDemoVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    self.navigationController.navigationBar.hidden = YES;
    UIView *topView = [[UIView alloc]init];
    [self.view addSubview:topView];
    topView.heroID = @"top";
//    topView.heroModifiers = @[[HeroModifier zPosition:[NSNumber numberWithFloat:1]]];
    topView.tag = 1000;
    topView.backgroundColor = [UIColor redColor];
    [topView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.right.mas_equalTo(self.view);
        make.height.mas_offset(200);
        
    }];
    
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    [self.view addSubview:btn];
    btn.backgroundColor = [UIColor blueColor];
    [btn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(self.view);
        make.width.mas_offset(100);
        make.height.mas_offset(50);
        make.top.mas_equalTo(self.view).mas_offset(100);
    }];
    [btn addTarget:self action:@selector(pushAction) forControlEvents:UIControlEventTouchUpInside];
}


- (void)pushAction{
    HeroTWODemoVC *vc = [[HeroTWODemoVC alloc]init];
    vc.isHeroEnabled = YES;
    
//   [self heroReplaceViewControllerWithNext:vc];
//    [self.navigationController pushViewController:vc animated:YES];
   [self presentViewController:vc animated:YES completion:nil];
}


#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}


@end
